
var ecarena = {
  onLoad: function() {
    // initialization code
    this.initialized = true;
    this.strings = document.getElementById("ecarena-strings");
	
	livehttpheaders.live.startHeaderInfoLive();
  },
  
  onUnLoad: function() {
  // 
	livehttpheaders.live.stopHeaderInfoLive();  
	//livehttpheaders.live.pref.savePrefFile();
  },

  onMenuItemCommand: function(e) {
  	alert("onMenuItemCommand");
    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                                  .getService(Components.interfaces.nsIPromptService);
    promptService.alert(window, this.strings.getString("helloMessageTitle"),
                                this.strings.getString("helloMessage"));
	
  },

  onToolbarButtonCommand: function(e) {
    // Toggles the toolbar and tabbox
    var toolbar = document.getElementById("ecarena-toolbar");
	var tabbox = document.getElementById("ecarena-tabbox");

    toolbar.collapsed = !toolbar.collapsed;
	tabbox.collapsed = !tabbox.collapsed;
    
	document.persist("ecarena-toolbar", "collapsed");
	document.persist("ecarena-tabbox", "collapsed");
  }
};

window.addEventListener("load", ecarena.onLoad, false);
window.addEventListener("unload", ecarena.onUnLoad, false);
